Conventional synchronous method calls, where the caller blocks until the completion of processing performed by the callee, may provide unsatisfactory results in some calling situations. By way of illustration, if the callee takes a long time to complete, the caller may be blocked for an unacceptable period of time waiting for the callee to return. Thus, resources (e.g., memory, processor cycles) associated with a blocked caller thread may be unavailable for other threads, reducing system performance. By way of further illustration, if the caller desires to make multiple calls to one or more callees, where, from the caller's point of view, such calls can be performed substantially in parallel, conventional synchronous method calling techniques may generate an unwanted, substantially serial performance.
Conventionally, synchronous calls can cause a thread to block. Threads are computationally and memory expensive. Therefore, having threads blocked can negatively impact system performance. It would be preferable to allow threads to enter a state (e.g., run to completion) where the resource can be freed, and thus reallocated, rather than being consumed by a blocked thread.
Due, at least in part, to undesired blocking, undesired resource consumption and undesired serial performance results from synchronous method calling a number of asynchronous method calling techniques have developed. Such asynchronous techniques are, in general, narrowly tailored to provide asynchronous calling capability for a specific programmatic situation. Such diverse, individually tailored asynchronous method calling techniques do not, in general, provide an efficient model to deal with asynchronous operations via a consistent programming model. Furthermore, objects employing such individually tailored asynchronous method calling techniques may require reprogramming to support asynchronous behavior. Such reprogramming may not be possible for existing objects, and thus it may be difficult, or impossible, to add asynchronous behavior to such existing objects.